package com.swiftride.feign;

import com.swiftride.config.FeignMultipartSupportConfig;
import com.swiftride.constants.Constants;
import com.swiftride.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = Constants.Remote.SERVICE_COMMON, path = "/cos"
        , contextId = "commonFeign", configuration = FeignMultipartSupportConfig.class)
public interface CommonFeign {

    @PostMapping(value = "/ServiceUploadFile/{folder}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    R<String> serviceUploadFile(@PathVariable("folder") String folder, @RequestPart("file") MultipartFile file);
}
